<template>
  <div>
    <!--定义表格-->
    <BasicTable @register="registerTable">
      <!-- 搜索区域插槽自定义查询 -->
      <!-- <template #form-email="{ model, field }">
        <a-input placeholder="请输入邮箱" v-model:value="model[field]" addon-before="邮箱:" addon-after=".com" />
      </template> -->
      <!--操作栏-->
    </BasicTable>
  </div>
</template>

<script lang="ts" name="basic-table-demo" setup>
  import { BasicTable } from '/@/components/Table';
  import { useListPage } from '/@/hooks/system/useListPage';
  import { tenantCheckInSearchFormSchema, tenantCheckInColumns } from '../analysisList.data';
  import { tenantCheckInList } from '../analysisList.api';

  // 列表页面公共参数、方法
  const { tableContext } = useListPage({
    designScope: 'basic-table-demo-filter',
    tableProps: {
      title: '',
      api: tenantCheckInList,
      columns: tenantCheckInColumns,
      formConfig: {
        schemas: tenantCheckInSearchFormSchema,
        fieldMapToTime: [['sendTime', ['sendTimeBegin', 'sendTimeEnd'], 'YYYY-MM-DD']],
      },
      useSearchForm: true,
      showTableSetting: false,
      showActionColumn: false,
      bordered: false,
      scroll: { x: 800 },
      beforeFetch: (params) => {
        let tjfw = '';
        if (params.tjfw) {
          let xzqy = params.tjfw.split(',');
          tjfw = xzqy[xzqy.length - 1];
        }

        return Object.assign(params, { tjfw });
      },
    },
  });
  //BasicTable绑定注册
  const [registerTable] = tableContext;
</script>

<style scoped lang="less">
  .jeecg-basic-table-form-container {
    padding: 0 !important;
    :deep(.ant-form) {
      margin-bottom: 12px !important;
      padding: 0 !important;
    }
  }
  :deep(.jeecg-basic-table) {
    .ant-table-wrapper {
      padding: 0 0 16px 0;
    }
  }
</style>
